package com.chuangjiangx.member.manager.web.web.score.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class CreateScoreGiftRequest {

    /**
     * 兑换条件
     */
    @NotNull(message = "{member.score.null}")
    @Min(1)
    private Long score;

    /**
     * 兑换商品名
     */
    @NotNull(message = "{member.goodName.null}")
    @Length(max = 15,message = "{member.name.length}")
    private String goodsName;

    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空")
    @DecimalMin(value = "0.01")
    private BigDecimal goodsPrice;

    /**
     * 图片地址
     */
    @NotBlank()
    private String imageURL;

    /**
     * 每人兑换限制
     */
    private Integer exchangeLimit;

    private String remark;
    /**
     * 商品总数量
     */
    @NotNull
    @Min(value = 1)
    private Integer totalGiftLimit;
    /**
     * 活动开始时间
     */
    @NotNull
    @JsonFormat(pattern = "yyyy-MM-dd HHmmss",timezone = "GMT+8")
    private Date startTime;
    /**
     * 活动结束时间
     */
    @NotNull
    @JsonFormat(pattern = "yyyy-MM-dd HHmmss",timezone = "GMT+8")
    private Date endTime;

}
